class SetGalleryTypesAndPhotoSizesToDefaultPriceList < ActiveRecord::Migration
  def self.up
    price_list = PriceList.find_by_name("default")
    if price_list.nil? 
      price_list = PriceList.new(:name => "default")
      price_list.save!
    end
    
    gallery_types = GalleryType.find(:all)
    gallery_types.each do |g|
      g.price_list = price_list
      g.save!
    end
    
    photo_sizes = PhotoSize.find(:all)
    photo_sizes.each do |p|
      p.price_list = price_list
      p.save!
    end
  end

  def self.down
  end
end
